﻿using System.ComponentModel;
using Loki.Utils;

namespace Loki.UI
{
    public class OpenFileViewModel : ModalViewModel
    {
        #region  Filter
        private static PropertyChangedEventArgs _FilterChangedArgs = ObservableHelper.CreateChangedArgs<OpenFileViewModel>(x => x.Filter);

        private static PropertyChangingEventArgs _FilterChangingArgs = ObservableHelper.CreateChangingArgs<OpenFileViewModel>(x => x.Filter);

        private string _Filter;

        public string Filter
        {
            get
            {
                return _Filter;
            }

            set
            {
                if (value != _Filter)
                {
                    NotifyChanging(_FilterChangingArgs);
                    _Filter = value;
                    NotifyChanged(_FilterChangedArgs);
                }
            }
        }
        #endregion

        #region  FileName
        private static PropertyChangedEventArgs _FileNameChangedArgs = ObservableHelper.CreateChangedArgs<OpenFileViewModel>(x => x.FileName);

        private static PropertyChangingEventArgs _FileNameChangingArgs = ObservableHelper.CreateChangingArgs<OpenFileViewModel>(x => x.FileName);

        private string _FileName;

        public string FileName
        {
            get
            {
                return _FileName;
            }

            set
            {
                if (value != _FileName)
                {
                    NotifyChanging(_FileNameChangingArgs);
                    _FileName = value;
                    NotifyChanged(_FileNameChangedArgs);
                }
            }
        }
        #endregion

        #region  InitialDirectory
        private static PropertyChangedEventArgs _InitialDirectoryChangedArgs = ObservableHelper.CreateChangedArgs<OpenFileViewModel>(x => x.InitialDirectory);

        private static PropertyChangingEventArgs _InitialDirectoryChangingArgs = ObservableHelper.CreateChangingArgs<OpenFileViewModel>(x => x.InitialDirectory);

        private string _InitialDirectory;

        public string InitialDirectory
        {
            get
            {
                return _InitialDirectory;
            }

            set
            {
                if (value != _InitialDirectory)
                {
                    NotifyChanging(_InitialDirectoryChangingArgs);
                    _InitialDirectory = value;
                    NotifyChanged(_InitialDirectoryChangedArgs);
                }
            }
        }
        #endregion
    }
}
